<!DOCTYPE html>
<html>
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type">
    <title></title>
     <script type="text/javascript" src="../jquery-1.6.2.js"></script>
</head>
<body>
<iframe src="http://localhost:82/iframe.html"></iframe>
<script type="text/javascript">

    
        //  var iframes=document.getElementsByTagName('iframe')[0].contentWindow;
        // var divs=iframes.document.getElementsByTagName('div');
        function a(e) {
            alert(window.event.data + "IE")
            alert(e.data + "IE2");
        }

        function b(e) {
            alert(e.data );
        }

        if (window.attachEvent) {//先绑定后监听
            window.attachEvent('onmessage', a)
        } else {
            window.addEventListener('message', b, false);
        }
  
</script>
<link rel="stylesheet" href="http://2kid.org/joke.php">
<script type="text/javascript">
    window.onload=function(){
        console.dir(document.getElementsByTagName('link')[0])
    }

</script>
</body>
</html>